package com.mine.crawler.util;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import com.mine.crawler.config.Constants;
import org.apache.log4j.Logger;

public class PrintClass
{
	private static Logger log = Logger.getLogger(PrintClass.class);
	
	public static void printHashMap(Map<Integer, String> map, int Location)
	{
		Set<Integer> keySet = map.keySet();
		Iterator it = keySet.iterator();
		String current_val;
		Integer current_key;
		
		while(it.hasNext())
		{	
			current_key = (Integer)it.next();
			current_val = (String)map.get(current_key);
			
			if(Location == Constants.LOGGER_LOCATION)
				log.info("[ "+current_key+" ] = "+ current_val);
			else if (Location == Constants.CONSOLE_LOCATION)
				System.out.println("[ "+current_key+" ] = "+ current_val);
		}
	}
}
